package com.tao.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Objects;

/**
 * @Author: alubus
 * @Date: 2021/11/11 17:09
 * @Package: com.tao.pojo
 */
@Data
public class Miaosha implements Serializable {
    /*
    秒杀物品的 id  名字  剩余量
    id通过数据库  查询 aid 来获取信息
     */

    private String id ;
    private String qname ;
    private int stock ;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getQname() {
        return qname;
    }

    public void setQname(String qname) {
        this.qname = qname;
    }

    public int getStock() {
        return stock;
    }

    public void setStock(int stock) {
        this.stock = stock;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Miaosha miaosha = (Miaosha) o;
        return stock == miaosha.stock && Objects.equals(id, miaosha.id) && Objects.equals(qname, miaosha.qname);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, qname, stock);
    }

    public Miaosha(String id, String qname, int stock) {
        this.id = id;
        this.qname = qname;
        this.stock = stock;
    }

    public Miaosha() {
    }

    @Override
    public String toString() {
        return "Miaosha{" +
                "id='" + id + '\'' +
                ", qname='" + qname + '\'' +
                ", stock=" + stock +
                '}';
    }
}
